Expand description
This library provides a Rust API for the JavaScriptCore engine.
Example
The JavaScriptCore engine lets you evaluate JavaScript scripts from your
own application. You first need to create a JSContext
object and then
call its evaluate_script
method.
use rusty_jsc::JSContext;
let mut context = JSContext::default();
match context.evaluate_script("'hello, world'", 1) {
Ok(value) => {
println!("{}", value.to_string(&context).unwrap());
}
Err(e) => {
println!(
"Uncaught: {}",
e.to_string(&context).unwrap()
)
}
}
Modules
Macros
Structs
- A JavaScript execution context.
- A JavaScript object.
- A JavaScript string.
- A JavaScript value.
- A JavaScript virtual machine.